package com.gitee.dupe.authority.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.gitee.dolt.boot.service.SuperServiceImpl;
import com.gitee.dupe.authority.dao.UserThirdIdMapper;
import com.gitee.dupe.authority.entity.User;
import com.gitee.dupe.authority.entity.UserThirdId;
import com.gitee.dupe.authority.service.IUserThirdIdService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author LYH
 * @since 2020-08-27
 */
@Service
public class UserThirdIdServiceImpl extends SuperServiceImpl<UserThirdIdMapper, UserThirdId> implements IUserThirdIdService {

    @Override
    public UserThirdId getOneByAppTypeAndAppIdAndThirdId(String appType, String appId, String thirdId) {
        return getOne(Wrappers.<UserThirdId>lambdaQuery().eq(
                UserThirdId::getAppType, appType
        ).eq(UserThirdId::getAppId, appId).eq(UserThirdId::getThirdId, thirdId));
    }

    @Override
    public UserThirdId getOneByAppTypeAndAppIdAndUserId(String appType, String appId, String userId) {
        return getOne(Wrappers.<UserThirdId>lambdaQuery().eq(
                UserThirdId::getAppType, appType
        ).eq(UserThirdId::getAppId, appId).eq(UserThirdId::getUserId, userId));
    }

    @Override
    public User getUserByAppTypeAndAppIdAndThirdId(String appType, String appId, String thirdId) {
        return baseMapper.getUserByAppTypeAndAppIdAndThirdId(appType, appId, thirdId);
    }


}
